import Tree2D from "./Tree2D";
import {TreeNode, TREENODE_TYPE} from "./Canvas2DItem";

class DecisionTree2D extends Tree2D{

  constructor(width, height){
    super(width, height);

    this.initDecisionTree2D();
  }

  initDecisionTree2D(){
    this.addAttribute('blockSize'   , 25        , 'number', '结点');
    this.addAttribute('blockBgColor', '#00f000' , 'color' , '结点');
    this.addAttribute('blockColor'  , '#000000' , 'color' , '结点');
  }

  addBlock(x, y, name){
    const newNode = new TreeNode(x, y, name, TREENODE_TYPE.Rectangle);
    this.items.push(newNode);
  }
}

export default DecisionTree2D;